<html>  <head>    <titleFacebook / Maps Mashup</title>    <style type="text/css">      @import url("http://www.google.com/uds/css/gsearch.css");      @import url("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css");      }    </style>    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAYgIFcdB73ikjsshF47qFhRT9MMXG_tYPVLibiAtjK-zmIeBb9RTQy57sFP4wbxEGLiuFm3mV7BVEKQ"       type="text/javascript"></script>    <script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0" type="text/javascript"></script>
    <script src="http://teamname.gan.tjohns.net/google/ClusterMarker.js" type="text/javascript"></script>    <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>        <script type="text/javascript">	var points;
	var parser;
	var map;

// New
	var myGMC;
	var myCluster;
	var marker;
	var marker_array=[];
	var exml;
	var mgr;
	var points;
	var coords;
	var descs;
// New (end)
      function initialize() {        if (GBrowserIsCompatible()) {
	        
          // Create and Center a Map          map = new GMap2(document.getElementById("map_canvas"));          map.addControl(new GLargeMapControl());          map.addControl(new GMapTypeControl());          map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));
	  map.setCenter(new GLatLng(40, -95), 4);
	  // mgr = new GMarkerManager(map);


		var add_to_names="";

 

		// Code to parse the kml file on our own
		if (window.ActiveXObject) {
  			parser=new ActiveXObject("Microsoft.XMLDOM");
  			parser.async=false;
  			parser.load("/goGreen/kmlFiles/3404940.kml");
  		}
		// code for Mozilla, Firefox, Opera, etc.
		else if (document.implementation && document.implementation.createDocument) {
        		parser = new XMLHttpRequest();
			parser.open( "GET", "/goGreen/kmlFiles/3404940.kml", false );
			parser.send(null);
		 	parser = parser.responseXML;
  		}
		else {
  			alert('Your browser cannot handle this script');
  		}


	// End kml parse code

	
		points = parser.getElementsByTagName( "name" );
		coords = parser.getElementsByTagName( "coordinates" );
		descs = parser.getElementsByTagName( "description" ); 
		for (i=0;i<points.length;i++) {
			add_to_names +="<a href = \"#none\" onmouseup= 'zoomOnFriend(\""+i+"\")'>";
			add_to_names +=points.item(i).firstChild.nodeValue+"</a><br>";
			var mycoords = coords.item(i).firstChild.nodeValue.split(",");
			 marker=newMarker(new GLatLng(mycoords[1], mycoords[0]),points.item(i).firstChild.nodeValue,descs.item(i).firstChild.nodeValue);
			 marker_array.push(marker);
		}
		
		document.getElementById("friend_names").innerHTML=add_to_names;	
		var cluster=new ClusterMarker(map, { markers:marker_array } );
		cluster.fitMapMaxZoom=2;
		cluster.intersectPadding=-1;
		cluster.refresh();



// <![CDATA["gshjfjbbzfgbzdfjkgbdzfl kkljsdfgh"]]>



		// mgr.refresh();
        }
      }

	function showFriends(qualifier) {
		if (qualifier==1) {
			var center = map.getBounds().getSouthWest().lat() + "," + map.getBounds().getSouthWest().lng()+ "   " + map.getBounds().getNorthEast().lat() + "," + map.getBounds().getNorthEast().lng();
          			//document.getElementById("test").innerHTML = center.toString() + " " + points.length;
				i=0;
				add_to_names="";
				while(i<points.length) {
					var mycoords = coords.item(i).firstChild.nodeValue.split(",");
					if(mycoords[1]<map.getBounds().getNorthEast().lat() && mycoords[1]> map.getBounds().getSouthWest().lat() && mycoords[0]<map.getBounds().getNorthEast().lng() && mycoords[0]>map.getBounds().getSouthWest().lng() ) {
						add_to_names +="<a href = \"#none\" onmouseup= 'zoomOnFriend(\""+i+"\")'>";
						add_to_names +=points.item(i).firstChild.nodeValue+"</a><br>";
					}
					document.getElementById("test").innerHTML=mycoords[1]+" "+mycoords[0];
					i++;
				}
				document.getElementById("friend_names").innerHTML=add_to_names;	
		} else {
			i=0;
				add_to_names="";
				while(i<points.length) {
					var mycoords = coords.item(i).firstChild.nodeValue.split(",");
					add_to_names +="<a href = \"#none\" onmouseup= 'zoomOnFriend(\""+i+"\")'>";
					add_to_names +=points.item(i).firstChild.nodeValue+"</a><br>";
					document.getElementById("test").innerHTML=mycoords[1]+" "+mycoords[0];
					i++;
				}
				document.getElementById("friend_names").innerHTML=add_to_names;	
		}

	}
	
	function addMark(marker,name,desc,n) {
		marker_array.push(marker);
	}

	function newMarker(markerLocation, markerId,markerDesc) {
		 var marker=new GMarker(markerLocation, {title:'Marker['+markerId+']'});
		 GEvent.addListener(marker, 'click', function() {
		  marker.openInfoWindowHtml(markerId+'<br><left>'+markerDesc+'</left>');
		});
		 return marker;
	}

	function zoomOnFriend(mystring) {
		document.getElementById("test").innerHTML=mystring;
		var mycoords = coords.item(mystring).firstChild.nodeValue.split(",");	
		var point = new GLatLng(mycoords[1], mycoords[0]);
		map.setZoom(15);
		map.setCenter(point);
 		map.openInfoWindow(point, points.item(mystring).firstChild.nodeValue+"<br><left>"+descs.item(mystring).firstChild.nodeValue+"</left>");


	}

      GSearch.setOnLoadCallback(initialize);    </script>  </head>  <body onload="initialize()" onunload="GUnload()">
	<center>
	<table border = "1">
	<tr><td colspan = "2"><img src = "/logo.jpg"></td></tr>
	<tr><td valign="top"><center><a href = "#none" onClick='showFriends(1)'>Refresh Friends in Area</a><br>
				     <a href = "#none" onClick='showFriends(0)'>Show All Friends</a>				
	</center><br><div id="friend_names"></div></td><td valign="top" width = "700"><center><div id="map_canvas" style="width: 700px; height: 480px"></div><center></td></tr>
	<tr><td><div if = "put_markers"></div></td></tr>	
	</table>
	</center>
	<div id = "test"></div>  </body></html>